/*
 * Copyright (C) 2009 Rafael Fernandes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.phonebooksharing.android.activities.pref;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;

import com.phonebooksharing.android.R;

public class PreferencesActivity extends PreferenceActivity {
    public static final String PREFERENCE_FILE_NAME = "pbs";
    
    public static final String PREF_DASH_FREQUENCY          = "pbs.dash-frequency",
                               PREF_NOT_SHR_FREQUENCY       = "pbs.not-sharing-frequency",
                               PREF_ENABLE_NEARBY_SERVICE   = "pbs.enable-nearby-service",
                               PREF_NEARBY_FREQUENCY        = "pbs.nearby-frequency",
                               PREF_NEARBY_ACCURANCY        = "pbs.nearby-accurancy",
                               PREF_DASH_NOTIFY_ENABLE      = "pbs.enable-dash-notify",
                               PREF_DASH_NOTIFY_RINGTONE    = "pbs.dash-ringtone",
                               PREF_DASH_NOTIFY_VIBRATE     = "pbs.dash-vibrate",
                               PREF_NEARBY_NOTIFY_ENABLE    = "pbs.enable-dash-notify",
                               PREF_NEARBY_NOTIFY_RINGTONE  = "pbs.dash-ringtone",
                               PREF_NEARBY_NOTIFY_VIBRATE   = "pbs.dash-vibrate",
                               PREF_DISPLAY_UNIT_CONVERT    = "pbs.display-unit-convert",
                               PREF_USE_MANUAL_LOCATION     = "pbs.use-manual-location",
                               PREF_MANUAL_LOCATION         = "pbs.manual-location",
                               PREF_EULA_ACCEPTED           = "pbs.eula-accepted"
                               ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getPreferenceManager().setSharedPreferencesName(PREFERENCE_FILE_NAME);
        addPreferencesFromResource(R.xml.preferences);
    }

    /**
     * Starts the PreferencesActivity for the specified user.
     *
     * @param context The application's environment.
     */
    public static void show(Context context) {
        final Intent intent = new Intent(context, PreferencesActivity.class);
        context.startActivity(intent);
    }
}
